hdparm 命令使用;关闭硬盘 HDD cache; 硬盘读写性能测试;

您所在的位置:网站首页 linux关闭硬盘 耗电吗 hdparm 命令使用;关闭硬盘 HDD cache; 硬盘读写性能测试;

hdparm 命令使用;关闭硬盘 HDD cache; 硬盘读写性能测试;

2024-07-11 11:30:40| 来源: 网络整理| 查看: 265

最新需要使用硬盘做一些测试,需要使用到hdparm工具,并进行了解,并进行简要记录;

hdparm、dd、fio、都是很好的硬盘测试软件;通常使用其对硬盘信息做基本了解;

关闭硬盘写Cache用例:

hdparm -W /dev/sdh # 查看写缓存状态; hdparm -W 0 /dev/sdh # 关闭Cache,保证数据强一致性;放置断电时数据未落盘; hdparm -W 1 /dev/sdh # 打开

测试磁盘和磁盘缓存读取速度:

查看磁盘信息: fdisk -l /dev/sdh hdparm /dev/sdh评估磁盘读取速度:hdparm -t /dev/sdh评估磁盘缓存读取速度:hdparm -T /dev/sdh直接测试硬盘的读性能(绕过内核页缓存):hdparm -tT --direct /dev/sdh顺序写测试:time -p  bash -c "dd if=/dev/urandom of=./dd.log bs=1M count=50000"随机写测试(使用direct标识,绕过页缓存):fio -filename=randw-singlethread -fallocate=none -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=libaio -bs=32k -size=1000M -runtime=30s -numjobs=1 -name=hdparm-randwsinglethread

命令使用方法说明:

hdparm -h hdparm - get/set hard disk parameters - version v9.43, by Mark Lord. Usage: hdparm [options] [device ...] Options: -a Get/set fs readahead -A Get/set the drive look-ahead flag (0/1) -b Get/set bus state (0 == off, 1 == on, 2 == tristate) -B Set Advanced Power Management setting (1-255) -c Get/set IDE 32-bit IO setting -C Check drive power mode status -d Get/set using_dma flag -D Enable/disable drive defect management -E Set cd/dvd drive speed -f Flush buffer cache for device on exit -F Flush drive write cache -g Display drive geometry -h Display terse usage information -H Read temperature from drive (Hitachi only) -i Display drive identification -I Detailed/current information directly from drive -J Get/set Western DIgital "Idle3" timeout for a WDC "Green" drive (DANGEROUS) -k Get/set keep_settings_over_reset flag (0/1) -K Set drive keep_features_over_reset flag (0/1) -L Set drive doorlock (0/1) (removable harddisks only) -m Get/set multiple sector count -M Get/set acoustic management (0-254, 128: quiet, 254: fast) -n Get/set ignore-write-errors flag (0/1) -N Get/set max visible number of sectors (HPA) (VERY DANGEROUS) -p Set PIO mode on IDE interface chipset (0,1,2,3,4,...) -P Set drive prefetch count -q Change next setting quietly -Q Get/set DMA queue_depth (if supported) -r Get/set device readonly flag (DANGEROUS to set) -R Get/set device write-read-verify flag -s Set power-up in standby flag (0/1) (DANGEROUS) -S Set standby (spindown) timeout -t Perform device read timings -T Perform cache read timings -u Get/set unmaskirq flag (0/1) -U Obsolete -v Use defaults; same as -acdgkmur for IDE drives -V Display program version and exit immediately -w Perform device reset (DANGEROUS) -W Get/set drive write-caching flag (0/1) -x Obsolete -X Set IDE xfer mode (DANGEROUS) -y Put drive in standby mode -Y Put drive to sleep -z Re-read partition table -Z Disable Seagate auto-powersaving mode --dco-freeze Freeze/lock current device configuration until next power cycle --dco-identify Read/dump device configuration identify data --dco-restore Reset device configuration back to factory defaults --direct Use O_DIRECT to bypass page cache for timings --drq-hsm-error Crash system with a "stuck DRQ" error (VERY DANGEROUS) --fallocate Create a file without writing data to disk --fibmap Show device extents (and fragmentation) for a file --fwdownload Download firmware file to drive (EXTREMELY DANGEROUS) --fwdownload-mode3 Download firmware using min-size segments (EXTREMELY DANGEROUS) --fwdownload-mode3-max Download firmware using max-size segments (EXTREMELY DANGEROUS) --fwdownload-mode7 Download firmware using a single segment (EXTREMELY DANGEROUS) --idle-immediate Idle drive immediately --idle-unload Idle immediately and unload heads --Istdin Read identify data from stdin as ASCII hex --Istdout Write identify data to stdout as ASCII hex --make-bad-sector Deliberately corrupt a sector directly on the media (VERY DANGEROUS) --offset use with -t, to begin timings at given offset (in GiB) from start of drive --prefer-ata12 Use 12-byte (instead of 16-byte) SAT commands when possible --read-sector Read and dump (in hex) a sector directly from the media --repair-sector Alias for the --write-sector option (VERY DANGEROUS) --security-help Display help for ATA security commands --trim-sector-ranges Tell SSD firmware to discard unneeded data sectors: lba:count .. --trim-sector-ranges-stdin Same as above, but reads lba:count pairs from stdin --verbose Display extra diagnostics from some commands --write-sector Repair/overwrite a (possibly bad) sector directly on the media (VERY DANGEROUS)

保持更新,更多内容请关注cnblogs.com/xuyaowen; 

相关参考:https://www.cnblogs.com/xuyaowen/p/fio-usage.html 



【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭